package com.kevin.hw.curator;

import org.apache.curator.framework.CuratorFramework;
import org.apache.zookeeper.data.Stat;

/**
 * @author: kevin
 * @date: 2017/8/14
 * @description:
 */
public class CuratorOperatorDemo {

    public static void main(String[] args) throws Exception {

        CuratorFramework curatorFramework = CuratorClientConnect.getInstance();


       /*String result = curatorFramework
                .create()
                .creatingParentsIfNeeded()
                .withMode(CreateMode.PERSISTENT)
                .forPath("/curator1/curator1-1","aaa".getBytes());
        System.out.println("result = "+result);*/



        /*curatorFramework
                .delete()
                .deletingChildrenIfNeeded()
                .forPath("/curator");*/

        Stat stat = new Stat();
        byte[] bytes = curatorFramework
                .getData()
                .storingStatIn(stat)
                .forPath("/node1");
        System.out.println("查询结果："+new String(bytes)+"stat:"+stat);


    }
}
